﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using W.Carrier.Domain;
using W.Carrier.Repostiory.Interface;

namespace W.Carrier.Repostiory.Impl
{
    public class CarrierRepository : BaseRepositoy<CarrierInfo>, ICarrierInfoRepository
    {
        public CarrierRepository(EFCoreDbContext context) : base(context)
        {
        }
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public async Task<int> AddAsync(CarrierInfo t)
        {
            return await base.AddAsync(t);
        }
        /// <summary>
        /// 列表显示
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<List<CarrierInfo>> GetAllAsync()
        {
            return await base.GetAllAsync();
        }
        /// <summary>
        /// 带条件的显示
        /// </summary>
        /// <param name="expr"></param>
        /// <returns></returns>
        public async Task<List<CarrierInfo>> GetAsync(Expression<Func<CarrierInfo, bool>> expr)
        {
            return await base.GetAsync(expr);
        }
        /// <summary>
        /// 根据id查询对应数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<CarrierInfo> GetModelAsync(int id)
        {
            return await base.GetModelAsync(id);
        }
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public async Task<int> Update(CarrierInfo t)
        {
            return await base.Update(t);
        }
        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        public async Task<int> UpdateRange(List<CarrierInfo> entities)
        {
            return await base.UpdateRange(entities);
        }
    }
}
